package com.javafish.spring.remoting.http.client;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.javafish.spring.remoting.service.hello_world.HelloWorld;
import com.javafish.spring.remoting.service.state_capital.StateCapitalService;

public class HttpRemotingClientTest {
  
  private static final Logger logger = LoggerFactory.getLogger(HttpRemotingClientTest.class);
   
  public HelloWorld hello;
  public StateCapitalService stateCapitalService;

  public void setHello(HelloWorld hello) {
    this.hello = hello;
  }
  
  public void setStateCapitalService(StateCapitalService stateCapitalService) {
    this.stateCapitalService = stateCapitalService;
  }

  public static void main(String[] args) {
    ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(
        new String[] {"com/javafish/spring/remoting/http/client/http-client-context.xml"});
    HttpRemotingClientTest t = appContext.getBean("httpRemotingClientTest", HttpRemotingClientTest.class);
    logger.info(t.hello.sayhello());
    logger.info(t.stateCapitalService.getCapital("Colorado"));
    logger.info(t.stateCapitalService.getCapital("Arizona"));
  }
}